package javacafe.action.seminar;

import java.util.List;

import javacafe.action.Action;
import javacafe.action.ActionForward;
import javacafe.dto.event.SeminarDTO;
import javacafe.dto.member.LoginInfoDTO;
import javacafe.serviceimple.SeminarServiceImple;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class UpdateSeminarAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub
		ActionForward actfoward = new ActionForward();
		SeminarServiceImple schservice = SeminarServiceImple.getInstance();
		
		String seminar_no = request.getParameter("seminar_no").trim();
		String seminar_name = request.getParameter("seminar_name");
		String seminar_explain = request.getParameter("seminar_explain");
		String seminar_map = request.getParameter("seminar_map");

		SeminarDTO dto = new SeminarDTO();
		
		dto.setSeminar_no(Integer.parseInt(seminar_no));
		dto.setSeminar_name(seminar_name);
		dto.setSeminar_explain(seminar_explain);
		dto.setSeminar_map(seminar_map);
						
		schservice.updateSeminar(dto);
		
		List<SeminarDTO> lists = schservice.getAllSeminar();
		
		request.setAttribute("sLists", lists);
		actfoward.setUrl("mycalendar");
		return actfoward;
	}
}
